package com.rent.collectrent.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author news
 * *@date 2025/9/28
 */
@Data
@TableName("rent_plan")
public class RentPlan implements Serializable {
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 承租人名称 */
    @TableField("tenant_name")
    private String tenantName;

    /** 项目编码 */
    @TableField("project_code")
    private String projectCode;

    /** 应收日期 */
    @TableField("due_date")
    private Date dueDate;

    /** 应收总金额 */
    @TableField("total_amount")
    private BigDecimal totalAmount;

    /** 应收本金 */
    @TableField("principal_amount")
    private BigDecimal principalAmount;

    /** 应收利息 */
    @TableField("interest_amount")
    private BigDecimal interestAmount;

    /** 实收本金 */
    @TableField("received_principal")
    private BigDecimal receivedPrincipal;

    /** 实收利息 */
    @TableField("received_interest")
    private BigDecimal receivedInterest;

    /** 核销状态:UNWRITTEN,PARTIAL_WRITTEN,WRITTEN */
    @TableField("write_off_status")
    private WriteOffStatus writeOffStatus;

    @Version
    private Integer version;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;

    public enum WriteOffStatus {
        // 未核销，部分核销，已核销
        UNWRITTEN, PARTIAL_WRITTEN, WRITTEN
    }

}
